# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=wireless-ids
pkgver=24.b132071
pkgrel=5
groups=('blackarch' 'blackarch-wireless' 'blackarch-sniffer' 'blackarch-defensive')
pkgdesc='Ability to detect suspicious activity such as (WEP/WPA/WPS) attack by sniffing the air for wireless packets.'
arch=('any')
url='https://github.com/SYWorks/wireless-ids'
license=('GPL2')
depends=('python2')
makedepends=('git')
source=("git+https://github.com/SYWorks/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 mac-oui.db "$pkgdir/usr/share/$pkgname/mac-oui.db"
  install -Dm 644 wids.py "$pkgdir/usr/share/$pkgname/wids.py"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 ./wids.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

